<template>
  请输入姓名:<input type:="text" v-model.lazy="username"/>
   <div>姓名是:{{username}}</div>
   请输入密码:<input type:="text" v-model.lazy="password"/>
   <div>姓名是:{{password}}</div>
   请输入第一个数字:<input type="text" v-model.number="num1"/>
   <br/>
   请输入第二个数字:<input type="text" v-model.number="num2"/>
    <br/>
   <!-- <div>和是: {{num1+num2}}</div> -->
    <button @click="add">计算和</button>
    <div>{{result}}</div>
</template>
<script setup>
//翟利辉
import { ref } from 'vue';
const username = ref("");
const password = ref("");
const num1 = ref("");
const num2 = ref("");
let result = ref(0);
function add(){
    result.value = num1.value+num2.value;
}
</script>

<style>

</style>